#include "cpu/exec/template-start.h"

#define instr lods

make_helper(concat(lods_,SUFFIX)) {
	REG(R_EAX) = swaddr_read(reg_l (R_ESI), DATA_BYTE, R_DS); //访问内存，存储到%eax中
	if(cpu.eflags.DF == 0) { //检查寄存器的方向标志位
        reg_l(R_ESI) += DATA_BYTE;
    }
	else{ 
        reg_l(R_ESI) -= DATA_BYTE;
    }
    
	print_asm("lods%s", str(SUFFIX));
	
	return 1;
}

#include "cpu/exec/template-end.h"